package com.lcz.study_designmode.行为模式.命令模式;

import java.util.Set;

/**
 * <pre>
 * <img width="128" height="110" src="https://tse3-mm.cn.bing.net/th/id/OIP-C.en-w_oH-yn2UsSRfWnOsGAHaGY?w=198&h=180&c=7&r=0&o=5&dpr=1.25&pid=1.7" alt="马刺">
 * 作者:     <a href="https://github.com/liuchuanzheng">刘传政</a>
 * 创建时间:  14:48 2022/6/17 0017
 * QQ:      1052374416
 * 电话:     18501231486
 * 描述:
 * </pre>
 */
public class OrderCommand implements Command {
    private Chef chef;
    private Order order;

    public OrderCommand(Chef chef, Order order) {
        this.chef = chef;
        this.order = order;
    }

    @Override
    public void excute() {
        System.out.println(order.dingNum + "桌");
        Set<String> strings = order.foodDir.keySet();
        for (String string : strings) {
            chef.makeFood(string, order.foodDir.get(string));
        }
        System.out.println(order.dingNum + "桌饭做好了");
    }
}
